<template>
  <!-- 主体 -->
  <div class="select_network_content" :style="{ top: `${curTop}vh` }">
    <!-- 标题 -->
    <div class="dialog_title">
      <div class="left"></div>
      <div class="center">选择网络</div>
      <div class="right">
        <img
          @click="curTop = 100"
          src="@/assets/common/close_icon.png"
          alt=""
        />
      </div>
    </div>
    <!-- 内容 -->
    <div class="dialog_content">
      <div class="notice add_text">
        <img src="@/assets/assets/warning_icon.png" alt="" />
        <div>
          当你充值该币时，仅限于通过下方支持的网络充值，如果您通过其他网络充值可能会造成资金丢失。
        </div>
      </div>
      <!-- 网络列表 -->
      <ul class="network_list">
        <li v-for="(item, index) in coins" :key="index" @click="chooseCoinNet(item)">
          <div class="add_text">{{ item.symbol }}-{{ item.primaryNet }}</div>
          <!-- <div>1次区块确认</div>
          <div>最低充值>0.01 USDT</div>
          <div>预计到账2分钟</div> -->
        </li>
      </ul>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

// 获取父组件属性和方法
defineProps(["coins"])
const emits = defineEmits(["choose"]);

// 滑动
const curTop = ref(100);

// 选择网络
const chooseCoinNet = (row: any) => {
  emits("choose", row);
  curTop.value = 100
};

// 显示抽屉
const showDrawer = (top: number) => {
  curTop.value = top;
};

defineExpose({
  showDrawer,
});
</script>

<style lang="scss" scoped>
.select_network_content {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 90vh;
  background-color: #202126;
  border-radius: 15px;
  padding: 20px;
  transition: all 0.5s;
  .dialog_title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .left,
    .right {
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
  .dialog_content {
    margin-top: 10px;
    .notice {
      background-color: #16e65c1a;
      display: flex;
      align-items: center;
      padding: 10px;
      div {
        text-align: left;
        margin-left: 10px;
        font-size: 14px;
      }
    }
    .network_list {
      margin-top: 10px;
      text-align: left;
      // overflow: scroll;
      // height: 70vh;
      li {
        padding: 10px;
        background-color: #384046;
        border-radius: 10px;
        margin-bottom: 10px;
        & > div {
          margin-bottom: 5px;
        }
        & > div:last-child {
          margin-bottom: 0;
        }
      }
    }
  }
}
</style>
